fix(ai): classify DeepSeek prompt cache lifetime - #1237
Open
Altairpaca wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds the DeepSeek prompt-cache lifetime fix on current
main(44923014d) and supersedes stale draft PR #835.Direct DeepSeek API sessions use provider-managed automatic caching. They must not be treated as having a deterministic five-minute TTL, fabricated cache-savings claims, or cache-preservation events intended for fixed-TTL providers.
Changes
PromptCacheLifetimeclassification at thepi-aiprovider boundary: fixed, automatic, disabled, or unknown.api.deepseek.comhostname, including case-insensitive host matching while rejecting malformed and spoofed URLs.cacheRetention: "none"precedence over automatic detection.test/suite/regressions/issue-831-unknown-cache-metrics.test.ts.Verification
git diff --check: passed.The full root check and real-CLI QA are currently environment-blocked in the isolated worktree: the worktree dependency tree lacks the declared
@bufbuild/protobufandtsxpackages, and this host is Nodev22.23.1while the repository root requires Node 24. The focused tests were run with disposable links to the already-installed locked protobuf package; those links were removed after each run. No credentials or network provider calls were used.This branch is based directly on current
mainand intentionally contains only the 13 files in the verified rebuild.Summary by cubic
Treats DeepSeek's automatic prompt caching as provider-managed with no fixed TTL instead of assuming the usual five-minute value. Explicitly disabled caching now suppresses all cache-warm telemetry, and issue #831's unknown-lane zero-token metric regression is fixed.
PromptCacheLifetimeclassification (fixed, automatic, disabled, unknown) at the@earendil-works/pi-aiprovider boundary and exports it.api.deepseek.comhostname, case-insensitively, and rejects malformed or lookalike URLs.cacheRetention: "none"now overrides provider detection.Written for commit 30c673e. Summary will update on new commits.